import 'package:dk_flutter_base/dk_ui.dart';
import 'package:flutter/cupertino.dart';

/// 圆角背景的文本
/// [backgroundColor]:背景颜色
/// [data]:标签内容

class TextRadiusBgWidget extends StatelessWidget {
  final int backgroundColor;
  final int dataColor;
  final double dataSize;
  final int topLeft;
  final int topRight;
  final int bottomLeft;
  final int bottomRight;
  final String data;
  TextRadiusBgWidget({this.backgroundColor,
    this.dataColor,
    this.dataSize,
    this.topLeft,
    this.topRight,
    this.bottomLeft,
    this.bottomRight,
    this.data}
      );
  @override
  Widget build(BuildContext context) {
    return Container(
      constraints: BoxConstraints(
        minWidth: 52,
      ),
      decoration: BoxDecoration(
        color: Color(backgroundColor),
        borderRadius: BorderRadius.only(
            topLeft: Radius.circular(topLeft.toDouble()),
            topRight: Radius.circular(topRight.toDouble()),
            bottomLeft: Radius.circular(bottomLeft.toDouble()),
            bottomRight: Radius.circular(bottomRight.toDouble())),
      ),
      padding: EdgeInsets.only(left: 8, top: 4, right: 8, bottom: 4),
      child: Text(data, style: TextStyle(color: Color(dataColor), fontSize: dataSize),),
    );
  }
}
